package com.qriver.cloud.consumer;

import com.sun.istack.internal.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * 测试接口
 */
@RestController
public class RibbonController {

    Logger logger = Logger.getLogger(RibbonController.class);

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("/ribbon")
    public String ribbon() {
        logger.info("执行消费者ConsumerController的consumer()方法！");
        String url = "http://eureka-provider/provider";
        return restTemplate.getForObject(url, String.class);

    }
}
